package j06bianyi;

public class J1 {
    public static void main(String[] args) {
//        throw new RuntimeException("运行时异常");


//        throw new Exception("编译时异常");
    }
}

//自定义运行时异常
//获取1,异常
class Exception1 extends RuntimeException{
    public Exception1() {
        //无参异常，错误之后，没有具体信息提示
    }

    public Exception1(String message) {
        //自定义提示语
        super(message);
    }
}

class ExcTest{
    public static void main(String[] args) {
        int num  = 1;
        if(num==1){
//            throw new Exception1();
            throw new Exception1("你怎么输入1了？");
        }
    }
}